package com.deram.ctin.serv.business.impl;

import com.deram.ctin.common.bean.PageResult;
import com.deram.ctin.serv.business.api.BusinessEnterAssetsApi;
import com.deram.ctin.serv.business.entity.BaseUpdateInfo;
import com.deram.ctin.serv.business.entity.BusinessEnterAssets;
import com.deram.ctin.serv.business.filter.BusinessEnterAssetsFilter;
import com.deram.ctin.serv.business.service.BusinessEnterAssetsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author: jtt
 * @Description:
 * @Date: 2017/9/13 15:57
 * @version: V1.0
 */
@RestController
public class BusinessEnterAssetsApiImpl implements BusinessEnterAssetsApi {

    @Autowired
    private BusinessEnterAssetsService businessEnterAssetsService;

    @Override
    public BusinessEnterAssets find(Long enterId) {
        return businessEnterAssetsService.find(enterId);
    }

    @Override
    public BusinessEnterAssets findByYear(Long enterId, Integer year) {
        return businessEnterAssetsService.findByYear(enterId, year);
    }

    @Override
    public List<BusinessEnterAssets> list(@RequestBody BusinessEnterAssetsFilter filter) {
        return businessEnterAssetsService.list(filter);
    }

    @Override
    public BusinessEnterAssets save(@RequestBody BusinessEnterAssets param) {
        return businessEnterAssetsService.save(param);
    }

    @Override
    public PageResult<BusinessEnterAssets> search(@RequestBody BusinessEnterAssetsFilter filter, @RequestParam("pageNo") Integer pageNo, @RequestParam("pageSize") Integer pageSize) {
        return businessEnterAssetsService.search(filter, pageNo, pageSize);
    }

    @Override
    public void delete(Long id) {
        businessEnterAssetsService.delete(id);
    }

    @Override
    public void saveList(@RequestBody BaseUpdateInfo<BusinessEnterAssets> updateInfo) {
        businessEnterAssetsService.saveList(updateInfo);
    }
}
